You are here: Trading System Programming > Reference > Classes > Execution > Execution Methods > getDateTime

getDateTime

The getDateTime method returns an instance of Date object representing execution's date/time.

Syntax

var getDateTime();

Return Value

The method returns a valid Date object instance.

Example

The following example demonstrates the use of getDateTime() method.

 

function start()

{

//retrieve account's executions orders

var account = getAccount();

var executions = account.getExecutions();

 

//loop through all executions

for(var i = 0; i < executions.length, i++)

{

var execution = executions[i];

 

//check to see how many days ago this execution happened

var difference = Application.getCurrentTime() - execution.getDateTime();

 

//since difference is in milliseconds, convert to days

difference = Math.round(difference / 1000 / 60 / 60 / 24);

}

 

//proceed further...

}

 


Copyright © 2006-2009 ActiveTick LLC